<template>
    <div class="box-content">
        <div class="content-top">
            <div class="topLeft">
                <div class="txt">
                    <h4>目标经营总额 </h4>
                    <p><span ref="number1">10</span>亿元</p>
                </div>
                <img src="@/assets/images/eachers/yinlang.png" alt="">
            </div>
            <div class="topRight">
                <div class="txt-box box">
                    <div class="number">
                        <p class="count" ref="number2">
                            75%
                        </p>
                        <p class="quyu">
                            省内
                        </p>
                    </div>
                </div>
                <div class="txt-box box1">
                    <div class="number">
                        <p class="count" ref="number3">
                            25%
                        </p>
                        <p class="quyu">
                            省外
                        </p>
                    </div>
                </div>
            </div>
        </div>
        <div class="content-bottom">
            <div class="bottom-box">
                <div class="box-left">
                    <div class="txt-box">
                        <h4 ref="number4">12025</h4>
                        <p>账款回收(万元)</p>
                        <div class="box-content">
                            <p>完成率</p>
                            <p >{{ recovery }}%</p>
                        </div>
                        <div class="progress-box">
                            <el-progress :percentage="recovery" :show-text="false" color="#00CEFF" />
                        </div>
                    </div>
                </div>
                <div class="box-right">
                    <div class="txt-box">
                        <h4 style="color: #F7E846;" ref="number5">88885</h4>
                        <p>经营额度(万元)</p>
                        <div class="box-content">
                            <p>完成率</p>
                            <p >{{ defaulters }}%</p>
                        </div>
                        <div class="progress-box">
                            <el-progress :percentage="defaulters" :show-text="false" color="#F7E846" />
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>
<script setup>
import { ref,onMounted} from 'vue'
import { CountUp } from 'countup.js'

let recovery = ref(50)
let defaulters = ref(70)


let number1 = ref(null)
let number2 = ref(null)
let number3 = ref(null)
let number4 = ref(null)
let number5 = ref(null)



onMounted(() => {
    new CountUp(number1.value, '9.68').start()
    new CountUp(number2.value, '55').start()
    new CountUp(number3.value, '45').start()
    new CountUp(number4.value, '12057').start()
    new CountUp(number5.value, '91283').start()
})

</script>
<style scoped lang='scss'>
.box-content {
    width: 100%;
    height: 100%;
    font-family: Electronic;
    .content-top {
        display: flex;
        align-items: center;
        justify-content: space-evenly;
        width: 100%;
        height: 45%;

        .topLeft {
            display: flex;
            flex-direction: column;
            width: 40%;
            height: 100%;

            .txt {
                display: flex;
                align-items: center;
                width: 100%;
                height: 60%;

                h4 {
                    font-family: PangMen;
                    color: #fff;
                }

                p {
                    color: #F7E846;
                    margin-left: 10px;

                    span {
                        font-size: 48px;
                    }
                }
            }
            img{
                height: 40%;
            }
        }

        .topRight {
            display: flex;
            width: 40%;
            height: 100%;

            .box {
                background-image: url('@/assets/images/eachers/bottomContent.png');
                background-size: 80%;
                background-repeat: no-repeat;
                background-position-x: center; //横轴居中
                background-position-y: center; //纵轴居中
            }

            .box1 {
                background-image: url('@/assets/images/eachers/bottomContent1.png');
                background-repeat: no-repeat;
                background-size: 80%;
                background-position-x: center; //横轴居中
                background-position-y: center; //纵轴居中
            }

            .txt-box {
                display: flex;
                flex-direction: column;
                align-items: center;
                width: 100%;
                justify-content: space-between;
                height: 100%;

                .number {
                    display: flex;
                    align-items: center;
                    flex-direction: column;

                    .count {
                        font-size: 22px;
                        color:  #00A0E9;
                    }

                    .quyu {
                        font-size: 14px;
                        color: #fff;
                        font-family: PangMen;
                    }
                }
            }
        }
    }

    .content-bottom {
        display: flex;
        flex-direction: column;
        width: 100%;
        height: 100%;

        .bottom-box {
            display: flex;
            align-items: center;
            justify-content: space-between;
            width: 100%;
            height: 55%;
            
            .box-left ,.box-right{
                padding: 0 50px 10px 50px;
                display: flex;
                flex-direction: column;
                color: #fff;
                width: 100%;
                height: 100%;
                background-image: url("@/assets/images/eachers/demo5Border.png");
                background-repeat: no-repeat;
                background-size: auto;
                background-position-x: center; //横轴居中
                background-position-y: center; //纵轴居中

                .txt-box {
                    display: flex;
                    flex-direction: column;
                    align-items: center;
                    width: 100%;
                    height: 100%;

                    h4 {
                        color: #00A0E9;
                        font-size: 30px;
                    }

                    p {
                        font-size: 12px;
                    }

                    .box-content {
                        display: flex;
                        align-items: center;
                        justify-content: space-between;
                        color: #ccc;
                        height: 40%;
                    }

                    .progress-box {
                        width: 100%;
                        background-color: rgba(0,0,0,.4);
                        height: 15%;
                        display: flex;
                        align-items: center;
                        justify-content: center;
                        border-radius: 8px;

                        .el-progress {
                            width: 98%;
                            :deep(.el-progress-bar__inner){
                                border-radius: 8px;
                                height: 100%;
                            }
                        }
                        
                    }
                }


            }
        }

    }
}
</style>
